//用nodejs写一个读取当前目录下city.txt文件，文件中每一行第一份数据是序号，然后是一个空格，第二份数据是城市的经纬度，经纬度用逗号分割，然后又是一个空格，第三份数据是省份-城市名称，省份和城市用“-”分割。然后将城市名称和经纬度写入到ciyt.xlsx文件中。

const fs = require("fs");
const XLSX = require("xlsx");
const path = require("path");
  
  const cityFile = path.join(__dirname, "../../views/rules/city.txt");
  const cityData = fs.readFileSync(cityFile, "utf8");
  const cityLines = cityData.split("\n");
  
  const workbook = XLSX.utils.book_new();
  const worksheet = XLSX.utils.json_to_sheet(cityLines);
  XLSX.utils.book_append_sheet(workbook, worksheet, "city");
  
  const xlsxFile = path.join(__dirname, "../../views/rules/citys.xlsx");
  XLSX.writeFile(workbook, xlsxFile);
  
  console.log("city.xlsx file created successfully!");